package com.hzqy.persistence.dao.wailian;


import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Repository;

import com.hzqy.persistence.dao.core.PersistenceDao;
import com.hzqy.web.vo.system.SysConfigVo;
import com.hzqy.web.vo.WlContentVo;
@Repository
public class WaiLianDao extends PersistenceDao<WlContentVo, Integer> {
	protected final Logger LOG = LoggerFactory.getLogger(getClass());

	public int insertWaiLian(WlContentVo wlvo) {
		return getSqlSession().insert(this.getNamespace() + "insertWaiLian", wlvo);
	}

	public List<WlContentVo> selectWaiLian(Map<String, Object> map) {
		
		return getSqlSession().selectList(this.getNamespace() + "selectWaiLian", map);
	}

	public int selectWaiLianCount(WlContentVo wlvo) {
		
		return getSqlSession().selectOne(this.getNamespace() + "selectWaiLianCount", wlvo);
	}

	public int deleteWailianContent(int f_wlc_id) {
		Map<String, Object> map = new HashMap<>();
		map.put("f_wlc_id", f_wlc_id);
		return getSqlSession().update(this.getNamespace() + "deleteWailianContent", map);
	}

	public WlContentVo selectWaiLianById(int f_wlc_id) {
		Map<String, Object> map = new HashMap<>();
		map.put("f_wlc_id", f_wlc_id);
		return getSqlSession().selectOne(this.getNamespace() + "selectWaiLianById", map);
	}

	public int updateWaiLianById(WlContentVo wlContentVo) {
		return getSqlSession().update(this.getNamespace() + "updateWaiLianById", wlContentVo);
	}

	public int reviewWaiLian(WlContentVo wlContentVo) {
		return getSqlSession().update(this.getNamespace() + "reviewWaiLian",wlContentVo);
	}

	public SysConfigVo selectSysConfig(SysConfigVo sysConfigVo) {
		return getSqlSession().selectOne(this.getNamespace()+"selectSysConfig",sysConfigVo);
	} 
	
	public WlContentVo selectWLContent(WlContentVo wlContentVo) {
		return getSqlSession().selectOne(this.getNamespace()+"selectWLContent",wlContentVo);
	}
	
	public List<WlContentVo> selectWlContent() {
		return getSqlSession().selectList(this.getNamespace() + "selectWlContent");
	}
}
